package cn.jiyun.res;

import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
public class JsonRes<T> implements Serializable {
    private Integer code;//0 成功 其它是失败
    private String msg;//提示消息
    private T data;

    public JsonRes() {
    }

    public JsonRes(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public JsonRes(Integer code, String msg,T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static JsonRes res(Integer code, String msg) {
        return new JsonRes(code, msg);
    }

    public static JsonRes resData(Integer code, String msg,Object data) {
        return new JsonRes(code, msg,data);
    }
}
